package com.yourenbang.lingyun.transaction.util;

import com.yourenbang.lingyun.constants.enums.fund.AccountType;

import java.util.Objects;

public class CommonUtils {

    /**
     * 转换账户名
     */
    public static String getAccountNameByAccountType(Integer accountType) {
        if (Objects.isNull(accountType)) {
            return "";
        }
        String accountName="";
        if (accountType == 21100300) {
            accountName = "合伙人分红收益账户";
        } else if (accountType == 21100420) {
            accountName = "合伙人奖励收益账户";
        } else if (accountType == 21100310) {
            accountName = "商户分红收益账户";
        } else if (accountType == 21100312) {
            accountName = "商户奖励收益账户";
        } else {
            if (Objects.nonNull(AccountType.getAccountType(accountType - 21000000))) {
                accountName = AccountType.getAccountType(accountType - 21000000).getAccountName();
            }
        }
        return accountName;
    }
}
